namespace VfAnswersNo
{
    using System;
    using System.Linq;
    using Rsdn.Janus;
    using Rsdn.Janus.CoreServices.ObjectModel;
    using Rsdn.Janus.DataModel;

    internal class AnswersNoMessage : VirtualForumMessage // why was Msg
    {

        public AnswersNoMessage(IServiceProvider provider)
            : base(provider)
        {
        }

        protected override void FillChildren()
        {
            // do nothing    
        }


        protected override IQueryable<IForumMessage> GetMessages(IJanusDataContext db)
        {
            return db.Messages(m => m.ParentID == 0 && m.TopicAnswers.Count() == 0);
        }

        protected override bool IsLoadAllMessages
        {
            get { return true; }
        }
    }
}